package com.eduadmin.service;

import com.eduadmin.entity.TeachInfo;
import com.eduadmin.mapper.TeachInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TeachInfoServiceImpl implements ITeachInfoService {

    private final TeachInfoMapper teachInfoMapper;

    @Autowired
    public TeachInfoServiceImpl(TeachInfoMapper teachInfoMapper) {
        this.teachInfoMapper = teachInfoMapper;
    }

    @Override
    public void addTeachInfos(List<TeachInfo> teachInfos) {
        teachInfoMapper.insertTeachInfos(teachInfos);
    }

    public List<TeachInfo> getTeacherNameByParam(String semesterName, String gradeName, String teamName, String courseName) {
        return teachInfoMapper.getTeacherNameByParam(semesterName, gradeName, teamName, courseName);
    }

    @Override
    public List<TeachInfo> getAllTeachInfo(Map<String, Object> paraMap) {
        return teachInfoMapper.selectAllTeachInfo(paraMap);
    }

    @Override
    public Long getAllTotal(Map<String, Object> paraMap) {
        return teachInfoMapper.selectAllTeachInfoTotal(paraMap);
    }

    @Override
    public List<TeachInfo> getTeachInfo(TeachInfo teachinfo) {
        return teachInfoMapper.selectTeachInfo(teachinfo);
    }

    @Override
    public int editTeachInfo(TeachInfo teachInfo) {
        return teachInfoMapper.updateTeachInfo(teachInfo);
    }

    @Override
    public int deleteTeachInfo(String teachIds) {
        return teachInfoMapper.deleteTeachInfo(teachIds);
    }

    @Override
    public List<TeachInfo> getTeachInfoByTeacherIdCard(String teacherIdCard) {
        return teachInfoMapper.selectTeachInfoByTeacherIdCard(teacherIdCard);
    }

    @Override
    public List<TeachInfo> getTeachInfoOfTeacher(Map<String, Object> paraMap) {
        return teachInfoMapper.selectTeachInfoOfTeacher(paraMap);
    }

}
